﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WPFTrees.DataStructures
{
    // http://codeidol.com/csharp/csharpckbk2/Data-Structures-and-Algorithms/Creating-an-n-ary-Tree/
    public class NTreeNodeFactory<T>
 where T : IComparable<T>
    {
        public NTreeNodeFactory(NTree<T> root)
        {
            maxChildren = root.MaxChildren;
        }

        private int maxChildren = 0;

        public int MaxChildren
        {
            get { return (maxChildren); }
        }

        public NTreeNode<T> CreateNode(T value)
        {
            return (new NTreeNode<T>(value, maxChildren));
        }
    }

}
